﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace _18miljard.UI.Controls
{
	public partial class BaseUserControl : System.Web.UI.UserControl
	{
		public BaseUserControl()
		{
			this.Load += new EventHandler(BaseUserControl_Load);
		}

		void BaseUserControl_Load(object sender, EventArgs e)
		{
			this.PreLoadHandler(sender, e);

			if (this.IsPostBack)
				this.OnPostBack(sender, e);
			else
			{
				this.WriteLog();
				this.OnFirstHit(sender, e);
			}

			this.PostLoadHandler(sender, e);
		}

		protected virtual void PreLoadHandler(object sender, EventArgs e)
		{ }

		protected virtual void PostLoadHandler(object sender, EventArgs e)
		{ }

		protected virtual void OnPostBack(object sender, EventArgs e)
		{ }

		protected virtual void OnFirstHit(object sender, EventArgs e)
		{ }

		protected virtual void WriteLog()
		{ }

	}
}